﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="QuanLyTangCa.aspx.cs"
    Inherits="ChamCong.Admin.QuanLyTangCa" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <!--Calendar Script-->
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/jscal.css" />
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/border-radius.css" />
    <script type="text/javascript" src="../Scripts/JSCal/js/jscal2.js"></script>
    <script type="text/javascript" src="../Scripts/JSCal/js/lang/vn.js"></script>
    <!--End Calendar-->
    <style type="text/css">
        .style1
        {
            width: 350px;
            margin: 10px;
            float: left;
        }
        .style2
        {
            width: 420px;
            margin: 10px;
            float: left;
        }
        .style3
        {
            width: 100px;
        }
        .style4
        {
            width: 300px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <table style="padding: 10px;">
            <tr>
                <td class="style4">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <strong>Trạng Thái Tăng Ca:</strong>
                            <asp:RadioButtonList ID="rblTangCa" runat="server">
                                <asp:ListItem Value="1">Thường</asp:ListItem>
                                <asp:ListItem Value="2">Tùy Chỉnh</asp:ListItem>
                                <asp:ListItem Value="3">Không</asp:ListItem>
                            </asp:RadioButtonList>
                            <asp:Button class="button" ID="btnChinhSua" runat="server" Text="Chỉnh Sửa" Width="100px"
                                OnClick="btnChinhSua_Click" />
                            <asp:Button class="button" ID="btnApDung" runat="server" Text="Áp Dụng" Width="80px"
                                OnClick="btnApDung_Click" />
                            <asp:Button class="button" ID="btnHuy" runat="server" Text="Hủy" Width="80px" OnClick="btnHuy_Click" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
                <td>
                    Chọn Trạng Thái Tăng Ca:
                    <br />
                    + Thường: Tính tăng ca với mọi trường hợp làm việc ngoài giờ hành chính.
                    <br />
                    + Tùy Chỉnh: Tính tăng ca theo lịch tăng ca đã thiết lập (bên dưới).
                    <br />
                    + Không: Không tính tăng ca cho bất kì trường hợp nào.<br />
                </td>
            </tr>
        </table>
    </div>
    <div class="style1">
        <asp:UpdatePanel ID="UpdateEdit" runat="server">
            <ContentTemplate>
                <table style="width: 100%;">
                    <tr>
                        <td class="style3">
                            Ngày:
                        </td>
                        <td>
                            <asp:TextBox ID="txtNgay" runat="server" Width="90%"></asp:TextBox>
                            <script type="text/javascript">
                                Cal = new Calendar({
                                    inputField: "txtNgay",
                                    dateFormat: "%d/%m/%Y",
                                    trigger: "txtNgay",
                                    bottomBar: false,
                                    onSelect: function () { this.hide(); }
                                });
                                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CallCalendar);
                                function CallCalendar(sender, args) {
                                    Cal = new Calendar({
                                        inputField: "txtNgay",
                                        dateFormat: "%d/%m/%Y",
                                        trigger: "txtNgay",
                                        bottomBar: false,
                                        onSelect: function () { this.hide(); }
                                    });
                                }
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            Lý Do :
                        </td>
                        <td>
                            <asp:TextBox ID="txtLyDo" runat="server" Width="90%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            Phòng Ban :
                        </td>
                        <td>
                            <div style="width: 90%; height: 100px; overflow: auto; background-color: #F2F2F2;">
                                <asp:CheckBoxList ID="cblPhongban" runat="server" DataSourceID="DSPhongBan" DataTextField="TenPB"
                                    DataValueField="MaPB">
                                </asp:CheckBoxList>
                                <asp:ObjectDataSource ID="DSPhongBan" runat="server" SelectMethod="LayTatCa" TypeName="BusinessLogicLayer.PhongBanBLL">
                                </asp:ObjectDataSource>
                                <asp:Label ID="lbPhongBan" runat="server"></asp:Label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            <div>
                                <sbc:sbcMsgBox ID="sbcMsgBox1" runat="server" UseJQuery="True" />
                            </div>
                            <asp:Button class="button" ID="btnThem2" runat="server" Text="Thêm" Width="70px"
                                OnClick="btnThem2_Click" />
                            <asp:Button class="button" ID="btnSua2" runat="server" Text="Sửa" Width="70px" OnClick="btnSua2_Click" />
                            <asp:Button class="button" ID="btnHuy2" runat="server" Text="Hủy" Width="70px" OnClick="btnHuy2_Click" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div class="style2">
        <asp:UpdatePanel ID="UpdateLichTangCa" runat="server">
            <ContentTemplate>
                Chọn năm:
                <asp:DropDownList ID="ddlNam" runat="server" AutoPostBack="True"
                    onselectedindexchanged="ddlNam_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:GridView ID="dgvLichTangCa" runat="server" AutoGenerateColumns="False" OnRowDataBound="dgvLichTangCa_rowdataboud"
                    Width="100%" CellPadding="4" ForeColor="#333333" GridLines="None" 
                    AllowPaging="True" PageSize="10">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="Ngay" HeaderText="Ngày" SortExpression="Ngay" DataFormatString="{0:dd/MM/yyyy}">
                            <HeaderStyle Width="90px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="LyDo" HeaderText="Lý Do" SortExpression="LyDo">
                            <HeaderStyle Width="220px" />
                        </asp:BoundField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="imgbtXem" ImageUrl="~/Scripts/Image/Xem.jpg" Width="18px" Height="18px"
                                    runat="server" OnClick="imgbtXem_Click" />
                                <asp:ImageButton ID="imgbtSua" ImageUrl="~/Scripts/Image/Sua.jpg" Width="18px" Height="18px"
                                    runat="server" OnClick="imgbtSua_Click" />
                                <asp:ImageButton ID="imgbtXoa" ImageUrl="~/Scripts/Image/Xoa.jpg" Width="18px" Height="18px"
                                    runat="server" OnClick="imgbtXoa_Click" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
                <p>
                    <sbc:sbcMsgBox ID="sbcMsgBox2" runat="server" UseJQuery="True" />
                </p>
                
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
